import 'package:easy_video/internal/http_client.dart';
import 'package:dio/dio.dart';

class UserApi {
  // 静态变量来保存唯一的实例
  static final UserApi _instance = UserApi._internal();

  // 私有构造函数
  UserApi._internal();

  // 工厂构造函数
  factory UserApi() {
    return _instance;
  }

  // 登录
  Future<Response> login(String mobile, String captcha) async {
    return HttpClient().post("/user/mobile_login", data: {
      "mobile": mobile,
      "captcha": captcha,
    });
  }

  Future<Response> info() async {
    return HttpClient().get("/user/info");
  }
}
